package ct.model;

public class Spline {
	private double range_min;
	private double range_max;
	// private double[] coefficients;
	Polynomial polynome;

	public Spline(int degree, double range_min, double range_max) {
		// this.coefficients = new double[degree+1];
		this.polynome = new Polynomial(degree);
		this.range_min = range_min;
		this.range_max = range_max;
	}

	public int getDegree() {
		return polynome.getDegree();
	}

	public double getRange_min() {
		return range_min;
	}

	public double getRange_max() {
		return range_max;
	}

	public void setCoeff(double[] coeff) {
		this.polynome = new Polynomial(coeff);
	}

	public Polynomial getPolynomial() {
		return this.polynome;
	}

	public double valueIn(double x) {
		return this.polynome.eval(x);
	}
}
